package com.xfpp.javaDemo.iterator;

import com.xfpp.javaDemo.iterator.Collection;
import com.xfpp.javaDemo.iterator.Node;

public class LinkedList implements Collection{
	private Node head = null;
	private Node tail = null;
	private int size = 0;
	
	public void add(Object o) {
		Node n = new Node(o,null);
		if(head == null) {
			head = n;
			tail = n;
		}
		tail.setNext(n);
		tail = n;
		size ++;
	}
	
	public int getSize() {
		return size;
	}

	@Override
	public Iterator iterator() {
		// TODO Auto-generated method stub
		return null;
	}
}
